/**
 * Created by ZY on 2018/05/13
 */
let _ = require('lodash'),
  util = require('../helper/util'),
  errCode = require('../../conf/errorCode'),
  logger = require('../helper/logger'),
  service = require('../services/commentService');

var tagLogger = new logger.TagLogger('COMMENT_CONTROLLER');

exports.getCommentByPostId = function(req, res, next) {
  let {postId, page, size} = req.query;
  service.getCommentByPostId(
    postId,
    page,
    size,
    util.getHandle(req, res, errCode.GET_COMMENT_BY_POST_ID),
  );
};

exports.deleteCommentByIds = function(req, res, next) {
  let ids = req.params.commentId;
  service.deleteCommentByIds(
    ids,
    util.getHandle(req, res, errCode.DELETE_POST_BY_IDS),
  );
};
